package cn.controller.product;

import cn.service.productService.ProductServiceImpl.AttributeServiceImpl;
import entity.productEntity.Attribute;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/20 22:47
 */
@RestController
@CrossOrigin
@RequestMapping("/product")
public class AttributeController {
    @Autowired
    AttributeServiceImpl service;
    @RequestMapping("/selectAttributeAll")
    public Result selectAttributeAll(Integer currentPage, Integer pageSize){
        return service.selsectAll(currentPage,pageSize);
    }
    @RequestMapping("/insertAttribute")
    public Result insertAttribute(@RequestBody Attribute attribute){
        return service.insertAttribute(attribute);
    }
    @RequestMapping("/updataAttribute")
    public Result updataAttribute(@RequestBody Attribute attribute){
        return service.updataAttribute(attribute);
    }
    @RequestMapping("/deleteAttribute")
    public Result deleteAttribute(Integer id){
        return service.deleteAttribute(id);
    }
    @RequestMapping("/getAttributeoption")
    public Result getAttributeoption(){
        return service.getAttributeoption();
    }

}
